<?php
class News extends CI_Controller{

    public function __construct()
    {
        parent::__construct();
        $this->load->model('news_model');
        $this->load->helper('url_helper');
    }

    public function index($id)
    {   
        $fenlei = $this->news_model->groupBy_news('title');
        $news = $this->news_model->get_news($id);
        var_dump($news);
        $data['news'] = $news[0]['content'];
        $data['title'] = $news[0]['title'];

        $this->load->view('templates/header',$data);
        $this->load->view('news/index',$data);
        $this->load->view('templates/footer');
    }

    public function view($slug = NULL)
    {
        $data['news_item'] = $this->news_model->get_news($slug);
    }
}
?>